package com.itheima.arrlist;

import java.util.ArrayList;

public class ArrayListDemo08 {
    public static void main(String[] args) {
        ArrayList<Teacher> list = new ArrayList<>();
        Teacher teacher1 = new Teacher("赵老师","javase");
        Teacher teacher2 = new Teacher("钱老师","javaee");
        Teacher teacher3 = new Teacher("赵老师","php");
        Teacher teacher4 = new Teacher("赵老师","python");
      list.add(teacher1);
      list.add(teacher2);
      list.add(teacher3);
      list.add(teacher4);
        for (int i = 0; i < list.size(); i++) {
            Teacher teacher = list.get(i);
            System.out.println(teacher.getName()+","+teacher.getMajor());
        }
    }
}
